/* ============================================
   ANIMATION SYSTEM
   ============================================ */

/* Initial state for all animated elements */
[data-animation] {
    opacity: 0;
    will-change: transform, opacity;
}

/* Animation Keyframes */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes slideLeft {
    from {
        opacity: 0;
        transform: translateX(40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideRight {
    from {
        opacity: 0;
        transform: translateX(-40px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(60px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes subtleFloat {
    0% {
        opacity: 0;
        transform: translateY(20px) scale(0.98);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* Animation Classes */
.animate-fade-up {
    animation: fadeUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-fade-in {
    animation: fadeIn 0.6s ease-out forwards;
}

.animate-slide-left {
    animation: slideLeft 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-right {
    animation: slideRight 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-zoom-in {
    animation: zoomIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-slide-up {
    animation: slideUp 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.animate-subtle-float {
    animation: subtleFloat 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Staggered Animation Support */
[data-stagger] > [data-animation] {
    opacity: 0;
}

/* Delay Classes (0ms to 1000ms) */
.delay-0 { animation-delay: 0ms !important; }
.delay-100 { animation-delay: 100ms !important; }
.delay-200 { animation-delay: 200ms !important; }
.delay-300 { animation-delay: 300ms !important; }
.delay-400 { animation-delay: 400ms !important; }
.delay-500 { animation-delay: 500ms !important; }
.delay-600 { animation-delay: 600ms !important; }
.delay-700 { animation-delay: 700ms !important; }
.delay-800 { animation-delay: 800ms !important; }
.delay-900 { animation-delay: 900ms !important; }
.delay-1000 { animation-delay: 1000ms !important; }

/* Image Lazy Loading */
.lazy-image {
    opacity: 0;
    transition: opacity 0.5s ease-out;
    background: #f5f5f5;
    min-height: 200px; /* Prevent layout shift */
}

.lazy-image.loaded {
    opacity: 1;
    background: transparent;
}

/* Blur effect during loading */
/* .lazy-image:not(.loaded) {
    filter: blur(5px);
} */

/* Section-based Animation */
.section-animate {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s ease, transform 0.8s ease;
}

.section-animate.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Container animations */
.container-animate {
    opacity: 0;
}

.container-animate.visible > * {
    animation: fadeUp 0.6s ease-out forwards;
}

/* Auto-stagger children */
.container-animate.visible > *:nth-child(1) { animation-delay: 0.1s; }
.container-animate.visible > *:nth-child(2) { animation-delay: 0.2s; }
.container-animate.visible > *:nth-child(3) { animation-delay: 0.3s; }
.container-animate.visible > *:nth-child(4) { animation-delay: 0.4s; }
.container-animate.visible > *:nth-child(5) { animation-delay: 0.5s; }
.container-animate.visible > *:nth-child(6) { animation-delay: 0.6s; }

/* Performance optimizations */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-up,
    .animate-fade-in,
    .animate-slide-left,
    .animate-slide-right,
    .animate-zoom-in,
    .animate-slide-up,
    .animate-subtle-float {
        animation: fadeIn 0.5s ease-out forwards !important;
        transform: none !important;
    }
    
    [data-animation] {
        opacity: 1 !important;
        transition: opacity 0.3s ease !important;
    }
}
 